<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('服务对象报餐明细列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>餐类别：</label>
                                <input type="text" name="eat"/>
                            </li>
                            <li>
                                <label>人类别：</label>
                                <input type="text" name="person"/>
                            </li>
                            <li>
                                <label>食物类别：</label>
                                <input type="text" name="food"/>
                                <input type="hidden" id="mealId" name="mealId"  th:value="${mealId}"  >
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-bordered">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('meal:mealList:edit')}]];
        var removeFlag = [[${@permission.hasPermi('meal:mealList:remove')}]];
        var prefix = ctx + "meal/mealList";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                queryParams: queryParams,
                modalName: "服务对象报餐明细",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'className',
                    title: '班级'
                },
                {
                    field: 'campus',
                    title: '园区'
                },
                {
                    field: 'reportDate',
                    title: '上报时间'
                },
                {
                    field: 'eat',
                    title: '餐类别'
                },
                {
                    field: 'person',
                    title: '人类别'
                },
                {
                    field: 'food',
                    title: '食物类别'
                },
                {
                    field: 'number',
                    title: '数量'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
        function queryParams(params) {
            var search = $.table.queryParams(params);
            search.serviceObjectsId = $("#mealId").val();;
            return search;
        }
    </script>
</body>
</html>